<template>
	<div :class="dantu.src?'':'customtext'">
	<span v-if="dantu.src?false:true">单图广告组件</span>
	<span v-if="dantu.src?false:true">(建议宽度不低于900px的jpg、png、gif)</span>
	<div v-if="dantu.src?true:false">
		<a :href="dantu.url" @click="myClick($event)">
		<van-image lazy-load :src="dantu.src" width="100%" height="200px"/>
	     </a>
	</div>
	</div>
</template>

<script>
  export default {
    // 接受父组件的值
	props:['dantu','prevent'],
	methods:{
		myClick(e){
			//阻止事件行为
	        if(this.prevent){
				e.preventDefault();
                return;
			}		
		}
	},
	created(){
	}
  }
</script>

<style lang="scss" scoped>
	.customtext {
		margin: 0 auto;
		background: #eee;
		width: 100%;
		height: 100px;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size:10px;
		flex-direction: column;
		text-align: center;
	  span{
		  font-size: 12px;
		  flex:1;
		  line-height: 50px;
	  }
	}
	 .my-swipe .van-swipe-item {
	    color: #fff;
	    font-size: 20px;
	    text-align: center;
	    //line-height: 150px;
	    //background-color: #39a9ed;
	  }
</style>
